//package com.one2manycall.service;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.security.core.userdetails.User;
//import org.springframework.security.core.userdetails.UserDetails;
//import org.springframework.security.core.userdetails.UserDetailsService;
//import org.springframework.security.core.userdetails.UsernameNotFoundException;
//import org.springframework.stereotype.Service;
//
//@Service
//public class CustomUserDetailsService implements UserDetailsService {
//
//    @Autowired
//    private UserServiceI userRepository;
//
//    @Override
//    public UserDetails loadUserByUsername(String userName) throws UsernameNotFoundException {
//        com.one2manycall.vo.User byUsername = userRepository.findByUsername(userName);
//
//
//        if (byUsername == null) {
//            throw new UsernameNotFoundException("User not found with userName: " + userName);
//        }
//
//        return User.withUsername(byUsername.getUserName())
//                .password(byUsername.getPassword())
//                .roles(byUsername.getRole())
//                .build();
//    }
//}